// File generated from our OpenAPI spec by Stainless.

package com.metest.api.services.async.rest.actuator

import com.metest.api.core.ClientOptions
import com.metest.api.core.RequestOptions
import com.metest.api.core.http.HttpResponseFor
import com.metest.api.models.rest.actuator.metrics.MetricListParams
import com.metest.api.models.rest.actuator.metrics.MetricListResponse
import com.metest.api.models.rest.actuator.metrics.MetricRetrieveByNameParams
import com.metest.api.models.rest.actuator.metrics.MetricRetrieveByNameResponse
import java.util.concurrent.CompletableFuture
import java.util.function.Consumer

interface MetricServiceAsync {

    /**
     * Returns a view of this service that provides access to raw HTTP responses for each method.
     */
    fun withRawResponse(): WithRawResponse

    /**
     * Returns a view of this service with the given option modifications applied.
     *
     * The original service is not modified.
     */
    fun withOptions(modifier: Consumer<ClientOptions.Builder>): MetricServiceAsync

    /** Actuator web endpoint 'metrics' */
    fun list(): CompletableFuture<MetricListResponse> = list(MetricListParams.none())

    /** @see list */
    fun list(
        params: MetricListParams = MetricListParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ): CompletableFuture<MetricListResponse>

    /** @see list */
    fun list(
        params: MetricListParams = MetricListParams.none()
    ): CompletableFuture<MetricListResponse> = list(params, RequestOptions.none())

    /** @see list */
    fun list(requestOptions: RequestOptions): CompletableFuture<MetricListResponse> =
        list(MetricListParams.none(), requestOptions)

    /** Actuator web endpoint 'metrics-requiredMetricName' */
    fun retrieveByName(
        requiredMetricName: String
    ): CompletableFuture<MetricRetrieveByNameResponse> =
        retrieveByName(requiredMetricName, MetricRetrieveByNameParams.none())

    /** @see retrieveByName */
    fun retrieveByName(
        requiredMetricName: String,
        params: MetricRetrieveByNameParams = MetricRetrieveByNameParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ): CompletableFuture<MetricRetrieveByNameResponse> =
        retrieveByName(
            params.toBuilder().requiredMetricName(requiredMetricName).build(),
            requestOptions,
        )

    /** @see retrieveByName */
    fun retrieveByName(
        requiredMetricName: String,
        params: MetricRetrieveByNameParams = MetricRetrieveByNameParams.none(),
    ): CompletableFuture<MetricRetrieveByNameResponse> =
        retrieveByName(requiredMetricName, params, RequestOptions.none())

    /** @see retrieveByName */
    fun retrieveByName(
        params: MetricRetrieveByNameParams,
        requestOptions: RequestOptions = RequestOptions.none(),
    ): CompletableFuture<MetricRetrieveByNameResponse>

    /** @see retrieveByName */
    fun retrieveByName(
        params: MetricRetrieveByNameParams
    ): CompletableFuture<MetricRetrieveByNameResponse> =
        retrieveByName(params, RequestOptions.none())

    /** @see retrieveByName */
    fun retrieveByName(
        requiredMetricName: String,
        requestOptions: RequestOptions,
    ): CompletableFuture<MetricRetrieveByNameResponse> =
        retrieveByName(requiredMetricName, MetricRetrieveByNameParams.none(), requestOptions)

    /**
     * A view of [MetricServiceAsync] that provides access to raw HTTP responses for each method.
     */
    interface WithRawResponse {

        /**
         * Returns a view of this service with the given option modifications applied.
         *
         * The original service is not modified.
         */
        fun withOptions(
            modifier: Consumer<ClientOptions.Builder>
        ): MetricServiceAsync.WithRawResponse

        /**
         * Returns a raw HTTP response for `get /rest/actuator/metrics`, but is otherwise the same
         * as [MetricServiceAsync.list].
         */
        fun list(): CompletableFuture<HttpResponseFor<MetricListResponse>> =
            list(MetricListParams.none())

        /** @see list */
        fun list(
            params: MetricListParams = MetricListParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): CompletableFuture<HttpResponseFor<MetricListResponse>>

        /** @see list */
        fun list(
            params: MetricListParams = MetricListParams.none()
        ): CompletableFuture<HttpResponseFor<MetricListResponse>> =
            list(params, RequestOptions.none())

        /** @see list */
        fun list(
            requestOptions: RequestOptions
        ): CompletableFuture<HttpResponseFor<MetricListResponse>> =
            list(MetricListParams.none(), requestOptions)

        /**
         * Returns a raw HTTP response for `get /rest/actuator/metrics/{requiredMetricName}`, but is
         * otherwise the same as [MetricServiceAsync.retrieveByName].
         */
        fun retrieveByName(
            requiredMetricName: String
        ): CompletableFuture<HttpResponseFor<MetricRetrieveByNameResponse>> =
            retrieveByName(requiredMetricName, MetricRetrieveByNameParams.none())

        /** @see retrieveByName */
        fun retrieveByName(
            requiredMetricName: String,
            params: MetricRetrieveByNameParams = MetricRetrieveByNameParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): CompletableFuture<HttpResponseFor<MetricRetrieveByNameResponse>> =
            retrieveByName(
                params.toBuilder().requiredMetricName(requiredMetricName).build(),
                requestOptions,
            )

        /** @see retrieveByName */
        fun retrieveByName(
            requiredMetricName: String,
            params: MetricRetrieveByNameParams = MetricRetrieveByNameParams.none(),
        ): CompletableFuture<HttpResponseFor<MetricRetrieveByNameResponse>> =
            retrieveByName(requiredMetricName, params, RequestOptions.none())

        /** @see retrieveByName */
        fun retrieveByName(
            params: MetricRetrieveByNameParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): CompletableFuture<HttpResponseFor<MetricRetrieveByNameResponse>>

        /** @see retrieveByName */
        fun retrieveByName(
            params: MetricRetrieveByNameParams
        ): CompletableFuture<HttpResponseFor<MetricRetrieveByNameResponse>> =
            retrieveByName(params, RequestOptions.none())

        /** @see retrieveByName */
        fun retrieveByName(
            requiredMetricName: String,
            requestOptions: RequestOptions,
        ): CompletableFuture<HttpResponseFor<MetricRetrieveByNameResponse>> =
            retrieveByName(requiredMetricName, MetricRetrieveByNameParams.none(), requestOptions)
    }
}
